#!/usr/bin/perl -w
use strict;
use Data::Dumper;

my %freqs;

while(<>){
  chomp;
  foreach my $word (split /\s+/, $_){
    $word = lc($word);
    $word =~ s/\.\,:;//;
    if($freqs{$word}){
      $freqs{$word}++;
    }
    else{
      $freqs{$word} = 1;
    }
  }
}

foreach my $key (sort(keys(%freqs))){
  printf("%s -> %s\n", $key, $freqs{$key});
}

